package org.qs.webservice.dao.user;


import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.qs.webservice.domain.UsBookReview;
import org.springframework.stereotype.Component;

@Component
public interface UsBookReviewMapper {
	/**
	 * 分页获取评论列表
	 * @param book_id
	 * @param review_type
	 * @param essence
	 * @param pages
	 * @param contents
	 * @return
	 */
	List<UsBookReview> getBookReviewByList(@Param("book_id")int book_id,@Param("review_type")int review_type,
			@Param("essence")int essence,@Param("pages")int pages,@Param("contents")int contents,@Param("chapter_id")int chapter_id);
	List<UsBookReview> getBookReviewListByUser(@Param("user_id")Long user_id,@Param("pages")int pages,@Param("contents")int contents);
	/**
	 * 获取评论条数
	 * @param book_id
	 * @param review_type
	 * @param essence
	 * @return
	 */
	int getBookReviewCountByList(@Param("book_id")int book_id,@Param("review_type")int review_type,@Param("essence")int essence,@Param("chap_id")int chap_id);
	int getBookReviewListByUserNum(@Param("user_id")Long user_id);
	/**
	 * 根据评论id获取评论
	 * @param review_id
	 * @return
	 */
	UsBookReview getReviewById(@Param("review_id")int review_id);
	/**
	 * 添加评论
	 * @param usBookReview
	 * @return
	 */
	int addReview(UsBookReview usBookReview);
	/**
	 * 删除评论
	 * @param review_id
	 * @return
	 */
	int deleteReview(@Param("review_id")int review_id);
	/**
	 * 增加回复次数
	 * @param rewiew_id
	 * @return
	 */
	int updateReviewNum(@Param("review_id")int review_id,@Param("num")int num);
	/**
	 * 设置置顶/取消置顶
	 * @param review_id
	 * @param top_value
	 * @return
	 */
	int updateReviewTop(@Param("review_id")int review_id,@Param("top_value")int top_value);
	/**
	 * 设置加精 取消加精
	 * @param review_id
	 * @param Essence_value
	 * @return
	 */
	int updateReviewEssence(@Param("review_id")int review_id,@Param("essence_value")int Essence_value);
	
	
}